﻿using System;

namespace UFrameWork
{
    /// <summary>
    /// 控制器基类
    /// </summary>
    public class UController
    {
        /// <summary>
        /// 执行Action
        /// </summary>
        /// <param name="key">命令名称</param>
        /// <param name="objs">参数列表</param>
        /// <returns></returns>
        protected void Action(string key, params object[] objs)
        {
            UWork.Do(key, objs);
        }

        /// <summary>
        /// 执行Action并返回结果
        /// </summary>
        /// <typeparam name="T">返回数据类型</typeparam>
        /// <param name="key">命令名称</param>
        /// <param name="objs">参数列表</param>
        /// <returns></returns>
        protected T Action<T>(string key, params object[] objs)
        {
            return UWork.Do<T>(key, objs);
        }
    }
}